<?php
/**
 * Created by PhpStorm.
 * User: xiangfeng
 * Date: 2022/4/20
 * Time: 3:35 PM
 */

namespace app\api\controller;


use app\api\service\WeminiService;

class Wemini extends BaseApi
{
    /**
     * 1、订阅消息发送
     */
    public function subscribeSend()
    {
        $param = $this->app->request->param();
        $redis = $this->redis;
        $key = USER_FARIAEND_JOIN_LIST . '_' . date('Ymd', time());
        $param['join_time'] = date('Y-m-d H:i:s', time());
        $redis->lPush($key, json_encode($param));
        //return $this->jsonSuccessResponse(WeminiService::sendMsg($param));
        return $this->jsonSuccessResponse($param);
    }

    /**
     * 2、获取模版id
     * @return \think\response\Json
     */
    public function getWeminiTmplIds()
    {
        return $this->jsonSuccessResponse(WeminiService::getTmplIds());
    }
}